package beautiful.butterfly.drds.data_exchange.plugin_collector;


import beautiful.butterfly.drds.data_exchange.communicator.AbstractContainerCommunicator;
import beautiful.butterfly.drds.data_exchange.report.Message;

import java.util.List;
import java.util.Map;


public final class DefaultJobPluginMessageCollector implements JobPluginMessageCollector
{
    private AbstractContainerCommunicator containerCommunicator;

    public DefaultJobPluginMessageCollector(AbstractContainerCommunicator containerCommunicator)
    {
        this.containerCommunicator = containerCommunicator;
    }


    public Map<String, List<String>> getMessage()
    {
        Message message = this.containerCommunicator.collect();
        return message.getTaskIdToMessageListMap();
    }


    public List<String> getMessage(String key)
    {
        Message message = this.containerCommunicator.collect();
        return message.getMessage(key);
    }
}
